package com.xyzwps.server.paimon.app.dto

import com.fasterxml.jackson.annotation.JsonInclude
import com.xyzwps.server.paimon.model.entity.User
import com.xyzwps.server.paimon.value.UserId
import kotlin.time.Instant

data class Me(
    val id: UserId,
    val nickname: String,
    val createdAt: Instant,
    @field:JsonInclude(JsonInclude.Include.NON_NULL)
    val token: String? = null
) {
    constructor(user: User, token: String? = null) : this(
        id = requireNotNull(user.id),
        nickname = user.nickname,
        createdAt = user.createdAt,
        token = token
    )
}
